home *** CD-ROM | disk | FTP | other *** search
-
- function units_helicopter_attack_alien_setup()
- units_setup(3,false,ENET_EFFECT_PS_SETUPSMOKE_MEDIUM,ENET_EFFECT_GEOMETRY_HELICOPTERSHADOW,true)
- local unit = uniGetExecutor()
- unit:getBone(ENBT_FAN,0):addRotationEffect(ENET_EFFECT_ROTATE_WHEEL,-MATH_PI * 2)
- unit:getBone(ENBT_FAN,1):addRotationEffect(ENET_EFFECT_ROTATE_WHEEL,-MATH_PI * 2)
- unit:getBone(ENBT_FAN,2):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI * 2)
- unit:getBone(ENBT_FAN,3):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,-MATH_PI / 4)
- unit:getBone(ENBT_FAN,3):addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERPROPELLER)
- unit:addSimpleEffect(ENET_EFFECTEMITTER_HELICOPTERWATERWAVES)
- unit:addSimpleEffect(ENET_EFFECT_HELICOPTER_WATERWAVES2)
- end
-
- function units_helicopter_attack_alien_resetup()
- units_setup(3,false,nil,ENET_EFFECT_GEOMETRY_HELICOPTERSHADOW,true)
- local unit = uniGetExecutor()
- unit:getBone(ENBT_FAN,0):addRotationEffect(ENET_EFFECT_ROTATE_WHEEL,-MATH_PI * 2)
- unit:getBone(ENBT_FAN,1):addRotationEffect(ENET_EFFECT_ROTATE_WHEEL,-MATH_PI * 2)
- unit:getBone(ENBT_FAN,2):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI * 2)
- unit:getBone(ENBT_FAN,3):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,-MATH_PI / 4)
- unit:getBone(ENBT_FAN,3):addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERPROPELLER)
- unit:addSimpleEffect(ENET_EFFECTEMITTER_HELICOPTERWATERWAVES)
- unit:addSimpleEffect(ENET_EFFECT_HELICOPTER_WATERWAVES2)
- end
-
- function units_helicopter_attack_alien_select()
- units_select(20,2)
- end
-
- function units_helicopter_attack_alien_unselect()
- units_unselect()
- end
-
- function units_helicopter_attack_alien_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_helicopter_attack_alien_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_helicopter_attack_alien_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_helicopter_attack_alien_explode()
- uniGetExecutor():getBone(ENBT_FAN,3):findEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERPROPELLER):destroy()
- units_explode_fire()
- end
-
- function units_helicopter_attack_alien_fire()
- uniSetLife(uniGetLife() / 2.0)
- local unit = uniGetExecutor()
-
- local wPos = unit:getWorldPosition()
- wPos.y = wPos.y + 30
- unit:play3DSound("chopper fade.wav",0)
- local up = unit:linearFly(wPos,50)
- local up_holder = enHolder:new(up)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITTOTARGET,MATH_PI / 1.5,uniGetTarget()))
- waitDeath(up)
- waitDeath(unit:getBone(ENBT_TARGET):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget()))
-
- local firespots = {}
- firespots[0] = unit:getBone(ENBT_FIRE1,0)
- firespots[1] = unit:getBone(ENBT_FIRE1,1)
- local recoils = {}
- recoils[0] = unit:getBone(ENBT_RECOIL,0)
- recoils[1] = unit:getBone(ENBT_RECOIL,1)
-
- firespots[0]:addSimpleEffect(ENET_EFFECT_HELICOPTERSHOT_FLY):executeCommand(ENC_FIRE1)
- unit:play3DSound("chopper fire2.wav",0)
- local shot2 = firespots[0]:addBulletEffect(ENET_EFFECT_PS_HELICOPTERSHOT)
- recoils[1]:gunRecoil(0,0.3,10.0)
- pause(0.3)
- firespots[1]:addSimpleEffect(ENET_EFFECT_HELICOPTERSHOT_FLY):executeCommand(ENC_FIRE1)
- unit:play3DSound("chopper fire2.wav",0)
- local shot2_2 = firespots[1]:addBulletEffect(ENET_EFFECT_PS_HELICOPTERSHOT)
- recoils[0]:gunRecoil(0,0.3,10.0)
-
- shot2:suspendedDestroy(0.5)
- shot2_2:suspendedDestroy(0.5)
-
- pause(0.5)
- unit:getBone(ENBT_TARGET):addRotationEffect(ENET_EFFECT_ROTATE_GUNDEFAULT,MATH_PI / 3.0)
- wPos.y = wPos.y - 30
- waitDeath(unit:linearFly(wPos,50))
-
- unit:addFireArrow()
- end
-
- function units_helicopter_attack_alien_move()
- local unit = uniGetExecutor()
- --local sound = unit:play3DSound("chopper.wav",1)
- waitDeath(unit:helicopterFly(uniGetPosition()))
- --[[
- local mover = unit:helicopterFly(uniGetPosition())
- local mover_holder = enHolder:new(mover)
- while mover:isAlive() do
- if getHeightType(unit:getWorldPosition()) == ENBHT_WATERHIT then
- local wave = unit:addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_WATERSHOCKWAVE)
- wave:setTransformOwner()
- end
- pause(0.1)
- end
- ]]--
- --sound:destroy()
- end
-
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_MOVE,"units_helicopter_attack_alien_move")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_FIRE1,"units_helicopter_attack_alien_fire")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_FIRE2,"units_helicopter_attack_alien_fire")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_SELECT,"units_helicopter_attack_alien_select")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_SELECTENEMY,"units_helicopter_attack_alien_selectenemy")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_UNSELECT,"units_helicopter_attack_alien_unselect")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_SETUP,"units_helicopter_attack_alien_setup")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_RESETUP,"units_helicopter_attack_alien_resetup")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_DAMAGED,"units_helicopter_attack_alien_damaged")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_EXPLODE,"units_helicopter_attack_alien_explode")
- registerCommand(ENSCRIPTSET_ATTCHOPPER_ALIEN,ENC_HIGHLIGHT,"units_helicopter_attack_alien_highlight")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_ATTCHOPPER_ALIEN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "copter_attack_alien.rmd"
- desc.ScriptSet = ENSCRIPTSET_ATTCHOPPER_ALIEN
- desc.MoveType = ENMOVE_FLYCONSTANTHEIGHT
- --desc.MoveType = ENMOVE_GROUND
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_HELICOPTERSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "copter_attack_alien.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(36)
- unitDesc.group = 2
- unitDesc.order = 3
- unitDesc.unit_res_id = ENET_UNIT_ATTCHOPPER_ALIEN
- unitDesc.unit_icon_id = "Attack_helicopter_a_small_normal.dds"
- unitDesc.active_id = "Attack_helicopter_a_small_active.dds"
- unitDesc.pressed_id = "Attack_helicopter_a_small_pressed.dds"
- unitDesc.big_icon_id = "attack_helicopter_a_big_normal.dds"
- unitDesc.small_icon_id = "Attackcopter_l_stats.dds"
- unitDesc.HP = 3
- unitDesc.MP = 40
- unitDesc.WR = 2
- unitDesc.min_WR = 0
- unitDesc.WD = 2
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 6
- unitDesc.transport = 0
- unitDesc.value = 3
- unitDesc.race = 1
- unitDesc.fire_pause = 0.6
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.07
- unitDesc.scn_name = "ATTCHOPPERA"
-
-
- -- effects related to unit
- executeScript("scripts\\helicopter_effects_scripts\\helicopter_waterwaves.lua")
-